package pro.softzhang.algo.lc300;

import pro.softzhang.algo.flag.knowledge.KDoublePointer;

public class LC392_IsSubsequence {
    public static void main(String[] args) {

    }

    @KDoublePointer
    static
    class Solution {
        public boolean isSubsequence(String s, String t) {
            int sl = s.length(), tl = t.length();
            int sp = 0, tp = 0;
            while (sp < sl && tp < tl) {
                if (s.charAt(sp) == t.charAt(tp)) {
                    sp++;
                }
                tp++;
            }
            return sp == sl;
        }
    }
}
